home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 23 / Amiga Format AFCD23 (Feb 1998, Issue 107).iso / +look_here_1st!+ / reader_requests / alienbreed3d2 / cheesesauce / c2p.asm < prev    next >
Assembly Source File  |  1997-11-28  |  2KB  |  124 lines

  1. ;=========================================================
  2. ; This chunky2planar routine was made by Ludde/Encore.
  3. ;
  4. ; You may uses it for whatever you want, but if you do
  5. ; it would be nice if you gave me credits if you release 
  6. ; anything! :)
  7. ;
  8. ; Send bug-reports, comments, optimise-tips, etc to:
  9. ;               
  10. ;     e-mail: ludvigp@ifi.uio.no       
  11. ;
  12. ;==========================================================
  13.  
  14.     IFD    _PHXASS_
  15.     MACHINE    68030
  16.     ENDIF
  17.  
  18.     incdir    "Include:"
  19.     include    "Ludde/Startup_macros.i"
  20.     include    "hardware/custom.i"
  21.  
  22. ;------------------ Startup Options ------------------------
  23.  
  24. KillSystem
  25. SaveInterrupts
  26. NewCopperList
  27.  
  28. ScreenWidth        =    320
  29. ScreenHeight        =    128
  30. Bitplanes        =    8
  31.  
  32. ScreenSize        =    ScreenWidth*ScreenHeight
  33. BitplaneSize        =    ScreenSize/8
  34.  
  35. ;-----------------------------------------------------------
  36.  
  37. ChunkyWidth        =    160
  38. ChunkyHeight        =    128
  39.  
  40. ChunkyPixels        =    ChunkyWidth*ChunkyHeight
  41.  
  42. ;ClearChunkyBuffer
  43.  
  44.     Section    MainProgram,code
  45.  
  46. j:
  47.     SaveSystem
  48.  
  49.     ClrINT    ALL
  50.     ClrINTQ    ALL
  51.     ClrDMA    ALL    
  52.  
  53.     jsr    SetupCopperList
  54.  
  55.     move.l    VectorBase,a0
  56.     move.l    #Lev3InterruptHandler,$6c(a0)
  57.  
  58.     SetDMA    DMAF_MASTER!DMAF_RASTER!DMAF_COPPER!DMAF_BLITTER!DMAF_SPRITE
  59.     SetINT    INTF_INTEN!INTF_VERTB
  60.  
  61. MainLoop:
  62.     RastPos    s_Render_time
  63.     bsr    Render
  64.     RastPos    e_Render_time
  65.  
  66.                                         ;Different routines:
  67.     jsr    c2p_2_Pass        ;1 cpu pass   = c2p_1_pass
  68.                     ;2 cpu passes = c2p_2_pass
  69.  
  70.     WaitMouse    MLeft,MainLoop
  71.  
  72.     RestoreSystem
  73.  
  74.     move.w    e_Render_time(pc),d0
  75.     sub.w    s_Render_time(pc),d0        ;Cpu c2p rastertime
  76.  
  77.     moveq    #0,d1
  78.     move.w    e_c2p_time(pc),d1
  79.     sub.w    s_c2p_time(pc),d1        ;Cpu c2p rastertime
  80.  
  81.     move.l    TellFrames,d7
  82.     muls.l    #50,d7
  83.     divs.l    TellTicks,d7            ;Average Frame Rate
  84.  
  85.     rts    
  86.  
  87. s_c2p_time:    dc.w    0
  88. e_c2p_time:    dc.w    0
  89. s_Render_time:    dc.w    0
  90. e_Render_time:    dc.w    0
  91. ;-----------------------------------------------------RENDER
  92.  
  93. Render:
  94.  
  95.             ; Here YOU do your stuff! :)
  96.                         
  97.     rts
  98.  
  99. ;-----------------------------------------------------
  100.  
  101.     Section ChunkyStuff,data
  102.     
  103. ;    blk.b    ChunkyPixels,"*"            ;Safety!
  104. ChunkyBuffer:
  105.     blk.b    ChunkyPixels,50
  106. ;    blk.b    ChunkyPixels,"*"            ;Safety!
  107.  
  108.  
  109. ;-----------------------------------------------------------------------------
  110.     include    "src3:wws/Blitter_c2p.i"
  111.     include    "Include:Ludde/Startup_code.i"
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.